﻿using log4net.Config;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace PlaceOrder_Core.Helper
{
    public static class Log4NetHelper
    {
        public static void ConfigureLogging()
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
        }
    }

    public static class LoggingService
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(LoggingService));

        static LoggingService()
        {
            // Initialize log4net configuration
            var logRepository = LogManager.GetRepository(Assembly.GetExecutingAssembly());
            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
        }

        public static void LogInfo(string message)
        {
            log.Info(message);
        }

        public static void LogError(string message, Exception ex)
        {
            log.Error(message, ex);
        }

        // Other logging methods...
    }
}
